package com.bdzl.biz.servicefeign;

import com.bdzl.biz.common.config.FeignConfig;
import com.bdzl.pub.config.Constant;
import com.bdzl.pub.entity.flow.ActChkRecDO;
import com.bdzl.pub.vo.biz.CheckVO;
import com.bdzl.pub.vo.flow.ActChkRecVO;
import com.bdzl.pub.vo.flow.ActNodeVO;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestParam;

import java.util.List;

@FeignClient(name="sysFlow", configuration = FeignConfig.class,contextId = "FlowFeignService",url = Constant.sys+":7003")
public interface FlowFeignService {
    /**
     * @Description: TODO 添加审核记录表
     * @param actChkRec 审核记录
     * @return: java.lang.Object
     * @Author: Ming
     * @Date: 2021/5/17 10:43
     */
    @PostMapping(value = "/bdzl/actChkRec/save")
    Object saveActChkRec(@RequestBody ActChkRecDO actChkRec);

    /**
     * @Description: TODO 根据订单号查询当前审核流程
     * @param odrNo 订单号
     * @param acrNodeId 当前节点id
     * @return: com.bdzl.pub.entity.flow.ActChkRecDO
     * @Author: Ming
     * @Date: 2021/5/17 20:15
     */
    @PostMapping(value = "/bdzl/actChkRec/getByOdrNo")
    List<ActChkRecDO> getByOdrNo(@RequestParam("odrNo") String odrNo,@RequestParam("acrNodeId") Integer acrNodeId);

    /**
     * @Description: TODO 更新审核记录表
     * @param actChkRec 审核记录表
     * @return: com.bdzl.pub.entity.flow.ActChkRecDO
     * @Author: Ming
     * @Date: 2021/5/17 20:15
     */
    @PostMapping(value = "/bdzl/actChkRec/update")
    ActChkRecDO update(@RequestBody ActChkRecDO actChkRec);

    /**
     * @Description: TODO 查询所有节点数据,正序排序
     * @param nodeActKey 所属工作流模型
     * @return: com.bdzl.pub.util.param.PageUtils
     * @Author: Ming
     * @Date: 2021/5/18 14:29
     */
    @PostMapping("/bdzl/actNode/getNode")
    List<ActNodeVO> getNode(@RequestParam("nodeActKey") String nodeActKey);

    /**
     * @Description: TODO 根据当前节点获取下一节点数据
     * @param annNodeNow 当前节点编号
     * @return: java.lang.String
     * @Author: Ming
     * @Date: 2021/5/18 16:15
     */
    @PostMapping("/bdzl/actNode/getNextNodeByNow")
    ActNodeVO getNextNodeByNow(@RequestParam("annNodeNow") Integer annNodeNow,@RequestParam("annFormula") String annFormula);

    /**
     * @Description: TODO 根据当前节点获取驳回节点数据
     * @param annNodeNow 当前节点编号
     * @return: java.lang.String
     * @Author: Ming
     * @Date: 2021/5/18 16:15
     */
    /*@PostMapping("/bdzl/actNode/getRejectNodeByNow")
    ActNodeVO getRejectNodeByNow(@RequestParam("annNodeNow") Integer annNodeNow);*/

    /**
     * @Description: TODO 根据节点id查询数据
     * @param nodeId 节点id
     * @return: com.bdzl.pub.util.param.R
     * @Author: Ming
     * @Date: 2021/5/18 17:38
     */
    @PostMapping("/bdzl/actNode/getByNodeId")
    ActNodeVO getByNodeId(@RequestParam("nodeId") Integer nodeId);


    /**
     * @Description: TODO 根据订单号查询审核通过，驳回数据
     * @param acrOdr 订单号
     * @return: com.bdzl.pub.util.param.R
     * @Author: Ming
     * @Date: 2021/5/18 17:38
     */
    @PostMapping("/bdzl/actNode/getNodeByacrOdr")
    CheckVO getNodeByacrOdr(@RequestParam("acrOdr") String acrOdr);

    /**
     * @Description: TODO 根据订单状态的值查询下一步节点数据
     * @param statVal 订单状态
     * @return: com.bdzl.pub.util.param.R
     * @Author: Ming
     * @Date: 2021/5/18 17:38
     */
    @PostMapping("/bdzl/actNode/getOdrStatusByStatVal")
    List<ActNodeVO> getOdrStatusByStatVal(@RequestParam("statVal") String statVal);

    /**
     * @Description: TODO 根据订单号查询所有审核流程
     * @param odrNo 订单号
     * @return: com.bdzl.pub.entity.flow.ActChkRecDO
     * @Author: Ming
     * @Date: 2021/5/17 20:15
     */
    @PostMapping(value = "/bdzl/actChkRec/getActChkRecByOdrNo")
    List<ActChkRecVO> getActChkRecByOdrNo(@RequestParam("odrNo") String odrNo);

    /**
     * @Description: TODO 查询除自己之外的流程状态
     * @param odrNo 订单号
     * @param acrNodeId 当前的节点id
     * @return: com.bdzl.pub.entity.flow.ActChkRecDO
     * @Author: Ming
     * @Date: 2021/5/17 20:15
     */
    @PostMapping(value = "/bdzl/actChkRec/getActChkRecByOdrNoNotAcrNodeId")
    List<ActChkRecVO> getActChkRecByOdrNoNotAcrNodeId(@RequestParam("odrNo") String odrNo,@RequestParam("acrNodeId") Integer acrNodeId);
}
